<%@page import="com.situ.student.entity.PageBean"%>
<%@page import="com.situ.student.dao.IStudentDao"%>
<%@page import="com.situ.student.entity.Student"%>
<%@page import="java.util.List"%>
<%@page import="com.situ.student.service.impl.StudentServiceImpl"%>
<%@page import="com.situ.student.service.IStudentService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

	<link rel="stylesheet" type="text/css" href="lib/bootstrap-3.3.7-dist/css/bootstrap.css"/>
	<script type="text/javascript" src="lib/jquery/jquery-1.11.1.js" ></script>
	<script type="text/javascript" src="lib/bootstrap-3.3.7-dist/js/bootstrap.js" ></script>
	<script>
			function xuan(){
				var check=$(".hby").prop("checked");
				if(check){
					$(".hby").prop("checked",true);
				}else {
					$(".hby").prop("checked",false);
				}
			}
		</script>
		<script type="text/javascript">
			function fanxuan(){
				for (var i=0;i<=student.length;i++) {
					var check=$(".hby").prop("checked");
					if(check) {
						$(".hby").prop("checked",false);
					}
					else {
						$(".hby").prop("checked",true);
					}
				} 
			 
			}
		</script>
</head>
<body>
	<%
		PageBean pageBean = (PageBean)request.getAttribute("pageBean");
	%>
	<%
		List<Student> list = (List<Student>)request.getAttribute("list");
	%>
	 <%
      pageContext.setAttribute("list", list);
   %>
	
	
	<td>
		<a href="Student_add.jsp">添加</a>
	</td>
	<td>
		<a href="">批量删除</a>
	</td>
	<br />
	<form action="<%=request.getContextPath()%>/student?method=list" method="post">
		<tr>
			<td>根据姓名查找</td>
			<td>
				<input type="text" name="name"/>
			</td>
			<td>
				<input type="submit" value="搜索" />
			</td>
		</tr>
		</form> 
		<br />
<table border="1" cellspacing="0">
	<tr>
			<td>
				<input type="checkbox" class="hby" onclick="xuan()" name="fuxuan" />全选(全不选)
			</td>
			
			<td>id</td>
			<td>姓名</td>
			<td>年龄</td>
			<td>性别</td>
			<td>修改</td>
			<td>删除</td>
		</tr>
		<% 
			for (Student student:list) { 
		%>
		<tr>
			<td>
				<input type="checkbox" class="hby" name="fuxuan"/>
			</td>
			
			<td><%=student.getId()%></td>
				<td><%=student.getName()%></td>
				<td><%=student.getAge()%></td>
				<td><%=student.getGender()%></td>
				<td>
				<a href="/Java823Web/student?method=update&id=<%=student.getId()%>">修改</a>
				</td>
				<td>
				<a href="/Java823Web/student?method=deleteById&id=<%=student.getId()%>">删除</a>
				</td>
		</tr>
		<%
			}
		%> 
</table>

<!-- 分页按钮 -->
	<nav aria-label="Page navigation">
  <ul class="pagination">
    <li>
      <a href="#" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
    <li><a href="#">1</a></li>
    <li><a href="#">2</a></li>
    <li><a href="#">3</a></li>
    <li><a href="#">4</a></li>
    <li><a href="#">5</a></li>
    <li>
      <a href="#" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>

</body>
</html>